/**
 * @class refrigeratory.pn_center
 * @extends Ext.Panel
 *
 * 主界面中央显示面板
 *
 * @author    Maple
 * @copyright (c) 2009, refrigeratory
 * @date      28. February 2011
 * @version   0.1
 * @revision  0.1
 *
 */

// create namespace
Ext.ns('refrigeratory');
refrigeratory.SITE_URL = '';

/**
 * Creates new refrigeratory.pn_center
 * @constructor
 * @param {Object} config A config object
 */
refrigeratory.pn_center = Ext.extend(Ext.Panel, {
    id: 'pn_content',
    region: 'center', 
    layout: 'card',
    margins: '2 5 5 0',
    activeItem: 0,
    border: false
    // {{{
    ,
    initComponent: function() {
        // hard coded config (it cannot be changed while instantiating)
        // {{{
        var config = {
            items : this.createTabPanel()
        }; // eo config object

        // apply config
        Ext.apply(this, Ext.apply(this.initialConfig, config));
        // }}}

        // call parent
        refrigeratory.pn_center.superclass.initComponent.apply(this, arguments);

        // parent call post-processing, e.g. install event handlers

    } // eo function initComponent
    // }}}
    // {{{
    ,
    onRender: function() {

        // parent call pre-processing

        // call parent
        refrigeratory.pn_center.superclass.onRender.apply(this, arguments);

        // parent call post-processing, e.g. install event handlers on rendered components

    } // eo function onRender
    // }}}
    
    // 需被本地化的文本
    ,startPageText: '起始页'
    
    // private 生成中央工作区域的标签面板 this.tabPanel
    ,createTabPanel: function(){
        this.tabPanel = new Ext.TabPanel({
            xtype: 'tabpanel',
            id: 'tbp_main',
            //plain: true,  //remove the header border
            activeItem: 0,
            resizeTabs: true,
            tabWidth: 150,
            width: 800,
            //defaults: {bodyStyle: 'padding:15px'},
            items:[{    
                id: 'pn_main',
                title: this.startPageText,
                layout: 'card',
                margins: '2 5 5 0',
                border: false,
                items: [new refrigeratory.pn_portal()]
            }]
        });
        return this.tabPanel;
    }
}); // eo extend

// register xtype
Ext.reg('pn_center', refrigeratory.pn_center);
// eof
